package com.jy.api.util;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * Created by lihu on 2018/1/29.
 */
@Component
public class InventoryUrlUtil {


    @Value("${inventory.address}")
    private String address;

    private static final String UPDATE_PRODUCT = "ADDRESS/v1/inventory/products";

    private static final String UPDATE_PRODUCT_TYPES = "ADDRESS/v1/inventory/product-types";

    private static final String COUNTER_QTY = "ADDRESS/v1/inventory/products/counter-qty?id=ID";


    private static final String STOCK_OUT = "ADDRESS/v1/inventory/stock-out";

    private static final String STOCK_IN = "ADDRESS/v1/inventory/stock-in";

    private static final String STOCK_CHECK = "ADDRESS/v1/inventory/stock-check";

    private static final String RECORD = "ADDRESS/v1/inventory/record?storeId=STOREID&page=PAGE&size=SIZE";

    private static final String RECORD_DETAILS = "ADDRESS/v1/inventory/record-details?id=ID";


    private static final String QUERY_RECORD_DETAILS = "ADDRESS/v1/inventory/query/record-details";


    private static final String CHECK_RECORD = "ADDRESS/v1/inventory/check-record?storeId=STOREID&page=PAGE&size=SIZE";

    private static final String CHECK_RECORD_DETAILS = "ADDRESS/v1/inventory/check-record-details?id=ID";


    /**
     * 查询盘点明细
     *
     * @return
     */
    public String getCheckRecordDetails() {
        return CHECK_RECORD_DETAILS.replace("ADDRESS", address);
    }


    /**
     * 查询盘点记录接口
     *
     * @return
     */
    public String getCheckRecord() {
        return CHECK_RECORD.replace("ADDRESS", address);
    }

    /**
     * 查询出入库详情
     *
     * @return
     */
    public String getQueryRecordDetails() {
        return QUERY_RECORD_DETAILS.replace("ADDRESS", address);
    }

    /**
     * 获取批量库存变动详情
     *
     * @return
     */
    public String getRecordDetails() {
        return RECORD_DETAILS.replace("ADDRESS", address);
    }

    /**
     * 获取出入库记录
     *
     * @return
     */
    public String getRecord() {
        return RECORD.replace("ADDRESS", address);
    }

    /***
     * 商品盘点
     * @return
     */
    public String getStockCheck() {
        return STOCK_CHECK.replace("ADDRESS", address);
    }

    /**
     * 商品入库(一级库)
     *
     * @return
     */
    public String getStockIn() {

        return STOCK_IN.replace("ADDRESS", address);
    }


    /**
     * 商品出库(一级库)
     *
     * @return
     */
    public String getStockOut() {

        return STOCK_OUT.replace("ADDRESS", address);
    }

    /**
     * 获取商品信息同步接口
     *
     * @return
     */

    public String getProductUrl() {
        return UPDATE_PRODUCT.replace("ADDRESS", address);
    }

    /**
     * 获取商品分类信息同步接口
     *
     * @return
     */
    public String getProductTypeUrl() {
        return UPDATE_PRODUCT_TYPES.replace("ADDRESS", address);
    }

    /**
     * 获取商品库存信息
     *
     * @return
     */
    public String getCounterQty() {
        return COUNTER_QTY.replace("ADDRESS", address);
    }
}
